﻿using System;
using System.Net.Mail;
using c5solutions.tools.QueuedSmtpClient;

namespace EmailTester
{
    class Program
    {
        static void Main(string[] args)
        {
            MailMessage email = new MailMessage();
            email.From = new MailAddress("noreply@c5solutions.de", "Foo Bar");

            email.To.Add(new MailAddress("test1@c5solutions.de", "Test1"));
            email.To.Add(new MailAddress("test2@c5solutions.de"));
            email.CC.Add(new MailAddress("test3@c5solutions.de", "Test3"));
            email.Bcc.Add(new MailAddress("test4@c5solutions.de"));

            email.Subject = "Test Email";
            email.Body = "<p>This is a test email.</p>";

            email.IsBodyHtml = true;
            email.Priority = MailPriority.High;

            QueuedSmtpClient smtpClient = new QueuedSmtpClient(@"d:\temp\emails", "smtp.yourserver.com", 25, 60);
            smtpClient.Credentials = new System.Net.NetworkCredential("username", "password");
            smtpClient.Send(email);

            Console.ReadLine();
        }
    }
}